Gbp-Pq: Name 0105-hsa-check-for-clang-target-hsail64.patch
if(RESULT)
message(FATAL_ERROR "LLVM support for amdgcn--amdhsa target is required")
endif()
- set(HSAIL_ENABLED 1)
+ # test that Clang supports the hsail64 target
+ message(CHECK_START "Check if Clang accepts -target hsail64")
+ custom_try_compile_clangxx("" "return 0;" RESULT "-target" "hsail64" "-emit-llvm" "-S")
+ if(RESULT)
+ message(CHECK_FAIL "no")
+ set(HSAIL_ENABLED 0)
+ else()
+ message(CHECK_PASS "yes")
+ set(HSAIL_ENABLED 1)
+ endif()
endif()
if (NOT DEFINED AMD_HSA)